//
//  ViewController.m
//  带属性的文字拼接
//
//  Created by zhangguo on 15/10/20.
//  Copyright © 2015年 zhangguo. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSTextAttachment * attachment = [[NSTextAttachment alloc] init];
    attachment.image = [UIImage imageNamed:@"composer_rating_small_icon_highlighted"];
    
    NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:attachment];
    
    
    NSMutableAttributedString *strM = [[NSMutableAttributedString alloc]initWithString:@"i "];
    [ strM appendAttributedString:string];
    [ strM appendAttributedString:[[NSMutableAttributedString alloc]initWithString:@"i "]];
    
    self.label.attributedText = strM;

}


@end
